<?php
    $error = false;
    if($this->Session->check('process_error')){
        if($this->Session->read('process_error') == 'yes'){
            $error = true;
        }
        $controller->Session->delete('process_error');
    }
?>
<?php
    $flash_msg = $this->Session->read('Message');
    if(isset($flash_msg['flash'])){
?>
    <div id="loginmsg" style="">
        <?php
            if($error){
                echo $this->Message->msg('Profile Update',$this->Session->flash(),'error',true);
            }
            else{
                echo $this->Message->msg('Profile Update',$this->Session->flash(),'success',true);
            }
        ?>
    </div>
<?php
    }
?>
<div id="cart" class="row-fluid">
    <div class="span6">
        <?php echo $this->Form->create('StaffUser', array('id' => 'form', 'class' => 'form form-horizontal', 'inputDefaults' => array('label' => false,'div' => false)));?>
        <fieldset>
            <legend>Edit your profile information, <?php echo $authuser['fname'];?> ! </legend>
            <div class="control-group">
                <label class="control-label" for="username">* Username:</label>
                <div class="controls">
                    <?php echo $this->Form->input('username', array('id'=>'username', 'class' => 'input-block-level', 'value'=>$authuser['username'],'required'=>'required','div' => false, 'label' => false,));?>
                </div>
            </div>

            <div class="control-group cheque_row">
                <label class="control-label" for="fname">* First Name:</label>
                <div class="controls">
                    <?php echo $this->Form->input('fname', array('id'=>'fname', 'class' => 'input-block-level', 'value'=>$authuser['fname'], 'required'=>'required','div' => false, 'label' => false,));?>
                </div>
            </div>
            <div class="control-group cheque_row">
                <label class="control-label" for="mname">Middle Name:</label>
                <div class="controls">
                    <?php echo $this->Form->input('mname', array('id'=>'mname', 'class' => 'input-block-level', 'value'=>$authuser['mname'],'div' => false, 'label' => false,));?>
                </div>
            </div>
            <div class="control-group cheque_row">
                <label class="control-label" for="lname">* Last Name:</label>
                <div class="controls">
                    <?php echo $this->Form->input('lname', array('id'=>'lname', 'class' => 'input-block-level', 'value'=>$authuser['lname'],'required'=>'required','div' => false, 'label' => false,));?>
                </div>
            </div>

            <div class="control-group cheque_row">
                <label class="control-label" for="password">Password:</label>
                <div class="controls">
                    <?php echo $this->Form->input('password', array('type'=>'password','id'=>'password', 'class' => 'input-block-level', 'placeholder'=>'Password','div' => false, 'label' => false,)); ?>
                </div>
            </div>

           <!-- <div class="control-group cheque_row">
                <label class="control-label" for="cellphone">Phone Number:</label>
                <div class="controls">
                    <?php /*echo $this->Form->input('cellphone', array('id'=>'cellphone', 'class' => 'input-block-level', 'value'=>$authuser['cellphone'], 'placeholder'=>'233-123456789','div' => false, 'label' => false,)); */?>
                </div>
            </div>-->

           <!-- <div class="control-group">
                <label class="control-label" for="email">Email:</label>
                <div class="controls">
                    <?php /*echo $this->Form->input('email', array('id'=>'email', 'class' => 'input-block-level', 'value'=>$authuser['email'],'placeholder'=>'example@you.com','div' => false, 'label' => false,)); */?>
                </div>
            </div>-->

            <div class="control-group">
                <label class="control-label">&nbsp;</label>
                <div class="controls">
                    <button type="submit" id="update_btn" class="btn btn-primary">Update Info</button>
                    <button type="reset"  id="reset_btn" class="btn">Cancel</button>
                </div>
            </div>

            <?php echo $this->Form->input('id', array('id'=>'id', 'value'=>$authuser['id'],'div' => false, 'label' => false,)); ?>
        </fieldset>
        <?php echo $this->Form->end();?>
    </div>
</div>


<script type="text/javascript">
    $(document).ready(function () {
       // $("#cellphone").mask("999-999999999");
    });
</script>